﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;

namespace InnovaApp.Layers.SecurityLayer
{
    public abstract class _SecurityLayer_Base
    {
        public enum enPasswordFormats { 
            PlainText = 0,
            Hashed = 1,
            Encrypted = 2
        }

        public static void SetApplicationNameWithAuthority()
        {
            string toReturn = string.Empty;
            string authority = HttpContext.Current.Request.Url.Authority;
            string[] tAuthority = authority.Split(':')[0].Split('.');
            List<string> lAuthority = new List<string>(tAuthority);
            tAuthority = lAuthority.ToArray();
            Membership.ApplicationName = String.Join(".", tAuthority).ToLower();
            Roles.ApplicationName = Membership.ApplicationName;
        }
    }
}
